\doxysection{C\+:/\+Users/\+ASUS/\+Desktop/dm-\/ctrl\+H7-\/balance-\/9025test/modules/motor/motor\+\_\+def.h File Reference}
\hypertarget{motor__def_8h}{}\label{motor__def_8h}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/motor/motor\_def.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/motor/motor\_def.h}}


电机通用的数据结构定义  


{\ttfamily \#include "{}controller.\+h"{}}\newline
{\ttfamily \#include "{}stdint.\+h"{}}\newline
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{struct_motor___control___setting__s}{Motor\+\_\+\+Control\+\_\+\+Setting\+\_\+s}}
\item 
struct \mbox{\hyperlink{struct_motor___controller__s}{Motor\+\_\+\+Controller\+\_\+s}}
\item 
struct \mbox{\hyperlink{struct_motor___controller___init__s}{Motor\+\_\+\+Controller\+\_\+\+Init\+\_\+s}}
\begin{DoxyCompactList}\small\item\em 电机控制器初始化结构体,包括三环\+PID的配置以及两个反馈数据来源指针 如果不需要某个控制环,可以不设置对应的pid config 需要其他数据来源进行反馈闭环,不仅要设置这里的指针还需要在\+Motor\+\_\+\+Control\+\_\+\+Setting\+\_\+s启用其他数据来源标志 \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{struct_motor___init___config__s}{Motor\+\_\+\+Init\+\_\+\+Config\+\_\+s}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{motor__def_8h_a1f51de96c4f8c9d729824a776dca074d}{LIMIT\+\_\+\+MIN\+\_\+\+MAX}}(x,  min,  max)
\end{DoxyCompactItemize}
\doxysubsubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{motor__def_8h_a306d656c63a2d986e7aff57a0526395d}\label{motor__def_8h_a306d656c63a2d986e7aff57a0526395d} 
enum \mbox{\hyperlink{motor__def_8h_a306d656c63a2d986e7aff57a0526395d}{Closeloop\+\_\+\+Type\+\_\+e}} \{ \newline
{\bfseries OPEN\+\_\+\+LOOP} = 0b0000
, {\bfseries CURRENT\+\_\+\+LOOP} = 0b0001
, {\bfseries SPEED\+\_\+\+LOOP} = 0b0010
, {\bfseries ANGLE\+\_\+\+LOOP} = 0b0100
, \newline
{\bfseries SPEED\+\_\+\+AND\+\_\+\+CURRENT\+\_\+\+LOOP} = 0b0011
, {\bfseries ANGLE\+\_\+\+AND\+\_\+\+SPEED\+\_\+\+LOOP} = 0b0110
, {\bfseries ALL\+\_\+\+THREE\+\_\+\+LOOP} = 0b0111
 \}
\begin{DoxyCompactList}\small\item\em 闭环类型,如果需要多个闭环,则使用或运算 例如需要速度环和电流环\+: CURRENT\+\_\+\+LOOP\texorpdfstring{$\vert$}{|}\+SPEED\+\_\+\+LOOP \end{DoxyCompactList}\item 
\Hypertarget{motor__def_8h_ac4dcec0ada61cfaf5b0bd6ced103d2e7}\label{motor__def_8h_ac4dcec0ada61cfaf5b0bd6ced103d2e7} 
enum {\bfseries Feedfoward\+\_\+\+Type\+\_\+e} \{ {\bfseries FEEDFORWARD\+\_\+\+NONE} = 0b00
, {\bfseries CURRENT\+\_\+\+FEEDFORWARD} = 0b01
, {\bfseries SPEED\+\_\+\+FEEDFORWARD} = 0b10
, {\bfseries CURRENT\+\_\+\+AND\+\_\+\+SPEED\+\_\+\+FEEDFORWARD} = CURRENT\+\_\+\+FEEDFORWARD \texorpdfstring{$\vert$}{|} SPEED\+\_\+\+FEEDFORWARD
 \}
\item 
\Hypertarget{motor__def_8h_a9bea14c1db85802fc7b8d059aab5725c}\label{motor__def_8h_a9bea14c1db85802fc7b8d059aab5725c} 
enum {\bfseries Feedback\+\_\+\+Source\+\_\+e} \{ {\bfseries MOTOR\+\_\+\+FEED} = 0
, {\bfseries OTHER\+\_\+\+FEED}
 \}
\item 
\Hypertarget{motor__def_8h_a5809caac35d81e6de59426d04853eca1}\label{motor__def_8h_a5809caac35d81e6de59426d04853eca1} 
enum {\bfseries Motor\+\_\+\+Reverse\+\_\+\+Flag\+\_\+e} \{ {\bfseries MOTOR\+\_\+\+DIRECTION\+\_\+\+NORMAL} = 0
, {\bfseries MOTOR\+\_\+\+DIRECTION\+\_\+\+REVERSE} = 1
 \}
\item 
\Hypertarget{motor__def_8h_a87635b08479660ebabc11606fe05e385}\label{motor__def_8h_a87635b08479660ebabc11606fe05e385} 
enum {\bfseries Feedback\+\_\+\+Reverse\+\_\+\+Flag\+\_\+e} \{ {\bfseries FEEDBACK\+\_\+\+DIRECTION\+\_\+\+NORMAL} = 0
, {\bfseries FEEDBACK\+\_\+\+DIRECTION\+\_\+\+REVERSE} = 1
 \}
\item 
\Hypertarget{motor__def_8h_ad9dd6e91ab43b80f918ee1a46a24e29d}\label{motor__def_8h_ad9dd6e91ab43b80f918ee1a46a24e29d} 
enum {\bfseries Motor\+\_\+\+Working\+\_\+\+Type\+\_\+e} \{ {\bfseries MOTOR\+\_\+\+STOP} = 0
, {\bfseries MOTOR\+\_\+\+ENALBED} = 1
 \}
\item 
\Hypertarget{motor__def_8h_a6a6704f2a1361279d93acbd382716e62}\label{motor__def_8h_a6a6704f2a1361279d93acbd382716e62} 
enum {\bfseries Motor\+\_\+\+Type\+\_\+e} \{ \newline
{\bfseries MOTOR\+\_\+\+TYPE\+\_\+\+NONE} = 0
, {\bfseries GM6020}
, {\bfseries M3508}
, {\bfseries M2006}
, \newline
{\bfseries LK9025}
, {\bfseries HT04}
 \}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
电机通用的数据结构定义 

\begin{DoxyAuthor}{Author}
neozng 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}
beta 
\end{DoxyVersion}
\begin{DoxyDate}{Date}
2022-\/11-\/01
\end{DoxyDate}
\begin{DoxyCopyright}{Copyright}
Copyright (c) 2022 HNU Yue\+Lu EC all rights reserved 
\end{DoxyCopyright}


\label{doc-define-members}
\Hypertarget{motor__def_8h_doc-define-members}
\doxysubsection{Macro Definition Documentation}
\Hypertarget{motor__def_8h_a1f51de96c4f8c9d729824a776dca074d}\index{motor\_def.h@{motor\_def.h}!LIMIT\_MIN\_MAX@{LIMIT\_MIN\_MAX}}
\index{LIMIT\_MIN\_MAX@{LIMIT\_MIN\_MAX}!motor\_def.h@{motor\_def.h}}
\doxysubsubsection{\texorpdfstring{LIMIT\_MIN\_MAX}{LIMIT\_MIN\_MAX}}
{\footnotesize\ttfamily \label{motor__def_8h_a1f51de96c4f8c9d729824a776dca074d} 
\#define LIMIT\+\_\+\+MIN\+\_\+\+MAX(\begin{DoxyParamCaption}\item[{}]{x}{, }\item[{}]{min}{, }\item[{}]{max}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{(x)\ =\ (((x)\ <=\ (min))\ ?\ (min)\ :\ (((x)\ >=\ (max))\ ?\ (max)\ :\ (x)))}

\end{DoxyCode}
